package cn.edu.zafu.bigdata.zengyadian;
import java.util.ArrayList;
import java.util.List;

class MaxFinder {
    public static <T extends Comparable<T>> T findMax(List<T> list){
        if(list.isEmpty()){
            return null;
        }
        T max = list.get(0);
        for(T element:list){
            if(element.compareTo(max)>0){
                max=element;
            }
        }
        return max;
    }
}

